﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuanLyGiaPha
    //commit test
{
    public partial class frmThongKeThanhTich : Form
    {
        public frmThongKeThanhTich()
        {
            InitializeComponent();
        }

        private void frmThongKeThanhTich_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'dtSet_ThongKeTT.LoaiThanhTich' table. You can move, or remove it, as needed.
            

            // TODO: This line of code loads data into the 'dtSet_ThongKeTV.DataTable1' table. You can move, or remove it, as needed.
            for (int i = 1990; i <= DateTime.Now.Year + 1; i++)
            {
                cbxNamBatDau.Items.Add(i);
                cbxNamKetThuc.Items.Add(i);
            }
            cbxNamBatDau.SelectedItem = 1990;
            cbxNamKetThuc.SelectedItem = 2014;
        }

        private void btnReport_Click(object sender, EventArgs e)
        {
            try
            {
                
                int inamdau = int.Parse(cbxNamBatDau.Text);
                int inamcuoi = int.Parse(cbxNamKetThuc.Text);
                if (inamcuoi > inamdau)
                {
                    string namdau = "1/1/" + cbxNamBatDau.SelectedItem;
                    string namcuoi = "1/1/" + cbxNamKetThuc.SelectedItem;
                    this.LoaiThanhTichTableAdapter.Fill(this.dtSet_ThongKeTT.LoaiThanhTich);
                    this.reportViewer1.RefreshReport();
                    DateTime nambatdau = DateTime.Parse(namdau);
                    DateTime namketthuc = DateTime.Parse(namcuoi);
                    
                    
                }
                else
                {
                    MessageBox.Show("Mời bạn chọn lại năm !", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {

                MessageBox.Show("Mời bạn chọn lại năm !", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
    }
}
